package com.thread;

import java.util.concurrent.atomic.AtomicInteger;

public class HappyLock {
    private static AtomicInteger nums = new AtomicInteger();
    public static void main(String[] args){
//        for(int i = 0; i < 100; i++){
//            new Thread(new Happy()).start();
//            System.out.println(HappyLock.nums);
//        }

    }
    public static void addNums(){
        try{

            nums.incrementAndGet();
            System.out.println(Thread.currentThread().getName() + "已执行");
        }
        catch (Exception e){
            System.out.println(e.getMessage());
        }

    }
}
